package admrouter

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/pkg/dingo"
)

type OmAdmRouter struct {
}

func NewOmAdmRouter() *OmAdmRouter {
	return &OmAdmRouter{}
}

func (w *OmAdmRouter) Init(e *gin.Engine) *gin.Engine {
	apiRouters := w.Include(
		InitUpload(),
		InitGoods(),
		InitRoom(),
		InitService(),
		InitAutomate(),
		InitAuthRouter(),
		InitDeviceRouter(),
		InitBusinessRouter(),
		InitPermissionRouter(),
		InitPlace(),
		InitUser(),
		InitOtherRouter(),
		InitSettingRouter(),
		InitDashboardRouter(),
		InitLogsRouter(),
		InitStatisticalRouter(),
		InitSiteSettingRouter(),
		InitOpenInterfaceRouter(),
		InitCashRouter(),
		InitImportRouter(),
		InitKaProjectRouter(),
		InitAnalysisRouter(),
		InitMemberRouter(),
		InitWifiRouter())

	g := e.Group("/v1")
	for _, f := range apiRouters {
		f(g)
	}
	return e
}

func (w *OmAdmRouter) Include(opts ...dingo.ApiRouter) []dingo.ApiRouter {
	apiRouters := make([]dingo.ApiRouter, 0)
	apiRouters = append(apiRouters, opts...)
	return apiRouters
}
